#include "stdafx.h"
#include "solitaire.h"
#include "cell.h"

cell::cell(const QPoint &pos)
    : space_(solitaire::CELL_SPACE)
    , radius_(solitaire::CELL_RADIUS)
    , color_(Qt::white)
    , coord_(pos)
{

}

cell::~cell()
{

}

void cell::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
{
    painter->setBrush(color_);
    painter->drawEllipse(-radius_, -radius_, 2 * radius_, 2 * radius_);
}

QRectF cell::boundingRect() const
{
    return QRectF(-radius_, -radius_, 2 * radius_, 2 * radius_);
}

void cell::set_color(const QColor &color)
{
    color_ = color;
}
